import request from '@/utils/request'

export function getUserList(data) {
  return request({
    url: '/admin/user/page',
    method: 'get',
    params: data
  })
}

export function getUser(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'get'
  })
}

export function updateUser(data) {
  return request({
    url: '/admin/user',
    method: 'put',
    data
  })
}

/**
 * 保存用户
 * @param {用户} data
 */
export function saveUser(data) {
  return request({
    url: '/admin/user',
    method: 'post',
    data
  })
}

/**
 *  删除用户
 * @param {id} id
 */
export function delUser(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'delete'
  })
}
